//package com.march.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.authentication.AuthenticationManager;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.config.http.SessionCreationPolicy;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
//
//import javax.annotation.Resource;
//
//@Configuration
//public class SecurityConfig extends WebSecurityConfigurerAdapter {
//
////    @Resource
////    private JwtAuthenticationTokenFilter jwtAuthenticationTokenFilter;
//    //密码的加密和解密
//    @Bean
//    public PasswordEncoder passwordEncoder(){
//        return new BCryptPasswordEncoder();
//    }
//
//    //认证
//    @Bean
//    @Override
//    protected AuthenticationManager authenticationManager() throws Exception {
//        return super.authenticationManagerBean();
//    }
//
//    // 配置放行的接口
////    @Override
////    protected void configure(HttpSecurity http) throws Exception {
////        http
////                // 关闭csrf
////                .csrf().disable()
////                // 不通过session获取SecurityContext
////                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
////                .and()
////                .authorizeRequests()
////                // 运行匿名访问的接口
////                .antMatchers("/employees/**").anonymous()
////                // 除了上面的接口外都要加上鉴权认证
////                .anyRequest().authenticated();
//////        http.addFilterBefore(jwtAuthenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
////    }
//}
